<template>
  <el-button :plain="true" @click="confirmAsync">Message</el-button>
  <el-button :plain="true" @click="customAsync">自定义</el-button>
</template>
<script lang="ts" setup>
import { useMessageBox } from '@fe-hl/admin-design-vue';
let message = useMessageBox();

let confirmAsync = () => {
  message.confirmAsync(() => {
    // 模拟ajax请求
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve(1);
      }, 5000);
    });
  }, '这是一条消息提示');
};

let customAsync = () => {
  message.confirmAsync(
    () => {
      // 模拟ajax请求
      return new Promise((resolve) => {
        setTimeout(() => {
          resolve(1);
        }, 5000);
      });
    },
    '这是一条消息提示',
    '标题1',
    '确定1',
    '取消1',
  );
};
</script>
